home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / AMScen_0_9.lha / AMScen / proving1.m < prev    next >
Text File  |  1995-01-21  |  16KB  |  445 lines

  1. /*
  2.  * Amiga MUD
  3.  *
  4.  * Copyright (c) 1995 by Chris Gray
  5.  */
  6.  
  7. /*
  8.  * proving1.m - shallow sewer level of the proving grounds.
  9.  */
  10.  
  11. private tp_proving1 CreateTable().
  12. use tp_proving1
  13.  
  14. define tp_proving1 m_drinkingGoblin CreateMonsterModel("goblin",
  15.     "The goblin is a small, humanoid creature with pale skin, large eyes, "
  16.     "protruding ears, and sharp teeth. It walks in a perpetual crouch but "
  17.     "is nonetheless quite fast on its feet.",
  18.     MonsterInit, RandomMove,
  19.     10, 8, 9, 6, 5, 40).
  20. m_drinkingGoblin@p_mBlocker := true.
  21. AddModelAction(m_drinkingGoblin, "slouches around").
  22. AddModelAction(m_drinkingGoblin, "gibbers").
  23. AddModelAction(m_drinkingGoblin, "drools").
  24. AddModelAction(m_drinkingGoblin, "howls").
  25. m_drinkingGoblin@p_mSpecialAction := monsterDrink.
  26.  
  27. /* also used in proving2.m */
  28.  
  29. define tp_proving proc monsterSet3(thing room)void:
  30.  
  31.     InitMonsterModels(room, 275);
  32.     AddPossibleMonster(room, m_rat, 25);
  33.     AddPossibleMonster(room, m_snake, 25);
  34.     AddPossibleMonster(room, m_largeRat, 25);
  35.     AddPossibleMonster(room, m_largeSnake, 25);
  36.     AddPossibleMonster(room, m_drinkingGoblin, 25);
  37. corp;
  38.  
  39. define tp_proving1 proc grateLiftDown(thing sewerRoom)void:
  40.  
  41.     Print("You lift the grate on hinges and climb down into the sewer.\n");
  42.     if Me()@p_pHidden then
  43.     OPrint("The drainage grate lifts for a moment, then closes.\n");
  44.     else
  45.     OPrint(FormatName(Me()@p_pName) +
  46.         " lifts the drainage grate and descends into the sewer below.\n");
  47.     fi;
  48.     LeaveRoomStuff(sewerRoom, D_DOWN, MOVE_SPECIAL);
  49.     EnterRoomStuff(sewerRoom, D_UP, MOVE_NORMAL);
  50. corp;
  51. define tp_proving1 proc grateLiftUp(thing theAlley)status:
  52.     string name;
  53.     bool hidden;
  54.  
  55.     name := FormatName(Me()@p_pName);
  56.     hidden := Me()@p_pHidden;
  57.     Print("You climb up to the grate, open it, and exit to the alley.\n");
  58.     LeaveRoomStuff(theAlley, D_UP, MOVE_NORMAL);
  59.     EnterRoomStuff(theAlley, D_DOWN, MOVE_SPECIAL);
  60.     if hidden then
  61.     OPrint("The drainage grate lifts for a moment, then closes.\n");
  62.     else
  63.     OPrint("The drainage grate lifts and " + name + " emerges.\n");
  64.     fi;
  65.     fail
  66. corp;
  67. define tp_proving o_drainageGrate CreateThing(nil).
  68. FakeModel(o_drainageGrate,
  69.     "grate,grating;large,drainage."
  70.     "grate,grating;large,drainage,drain,overhead."
  71.     "overhead;large,drainage,drain,grating,grate."
  72.     "frame;wooden.handle.bar;iron",
  73.     "The grate is made of iron bars secured into a wooden frame. It has a "
  74.     "handle on one side.").
  75. o_drainageGrate@p_oSmellString := "The grate smells of the sewer below.".
  76. o_drainageGrate@p_oTouchString := "The grate is VERY dirty.".
  77. o_drainageGrate@p_oLowerString := "The grate cannot be lowered any further.".
  78. o_drainageGrate@p_oNotLocked := true.
  79. define tp_proving o_fakeGrate CreateThing(nil).
  80. FakeModel(o_fakeGrate, "grate,grating;large,drainage,drain", "").
  81. o_fakeGrate@p_oLiftString := "The grate is out of reach from here.".
  82. o_fakeGrate@p_oOpenString := "The grate is out of reach from here.".
  83. o_fakeGrate@p_oLowerString := "The grate is out of reach from here.".
  84. o_fakeGrate@p_oNotLocked := true.
  85.  
  86. define tp_proving1 o_trickle CreateThing(nil).
  87. SetupObject(o_trickle, nil, "water.stream.trickle", "").
  88. o_trickle@p_oInvisible := true.
  89. o_trickle@p_oNotGettable := true.
  90. define tp_proving1 proc trickleDrink()status:
  91.     thing me;
  92.     string name;
  93.     int current, max;
  94.  
  95.     me := Me();
  96.     name := FormatName(me@p_pName);
  97.     if not me@p_pHidden then
  98.     OPrint(name + " takes a drink from the noxious trickle.\n");
  99.     fi;
  100.     current := me@p_pHitNow;
  101.     if Parent(me) = m_drinkingGoblin then
  102.     max := me@p_pHitMax;
  103.     if current ~= max then
  104.         current := current + Random(3) + 2;
  105.         if current > max then
  106.         current := max;
  107.         fi;
  108.         me@p_pHitNow := current;
  109.     fi;
  110.     else
  111.     Print("ACK!!! It tastes horrible!\n");
  112.     max := Random(3) + 2;
  113.     if max >= current then
  114.         /* DOOM */
  115.         if me@p_pStandard then
  116.         Print("You are killed!\n");
  117.         if not me@p_pHidden then
  118.             OPrint(name + " dies!\n");
  119.         fi;
  120.         KillPlayer(me, me);
  121.         else
  122.         KillMonster(me);
  123.         fi;
  124.     else
  125.         me@p_pHitNow := current - max;
  126.     fi;
  127.     fi;
  128.     succeed
  129. corp;
  130. o_trickle@p_oEatChecker := trickleDrink.
  131. define tp_proving1 o_drink CreateThing(nil).
  132. SetupObject(o_drink, nil, "drink.swallow", "").
  133. o_drink@p_oInvisible := true.
  134. define tp_proving1 proc takeDrink(thing drink)status:
  135.     trickleDrink()
  136. corp;
  137. o_drink@p_oGetChecker := takeDrink.
  138.  
  139. /* also used in proving2.m */
  140.  
  141. define tp_proving r_provingTunnel1 CreateThing(r_tunnel).
  142. AutoGraphics(r_provingTunnel1, AutoTunnels).
  143. AutoPens(r_provingTunnel1, C_DARK_GREY,C_LIGHT_GREY,C_LIGHT_GREY,C_LIGHT_GREY).
  144. SetThingStatus(r_provingTunnel1, ts_readonly).
  145. monsterSet3(r_provingTunnel1).
  146.  
  147. define tp_proving r_provingTunnel2 CreateThing(r_tunnel).
  148. AutoGraphics(r_provingTunnel2, AutoTunnels).
  149. AutoPens(r_provingTunnel2, C_DARK_GREY,C_LIGHT_GREY,C_LIGHT_GREY,C_LIGHT_GREY).
  150. SetThingStatus(r_provingTunnel2, ts_readonly).
  151.  
  152. define tp_proving r_provingTunnelD CreateThing(r_tunnel).
  153. r_provingTunnelD@p_rDark := true.
  154. AutoGraphics(r_provingTunnelD, AutoTunnels).
  155. AutoPens(r_provingTunnelD, C_DARK_GREY,C_LIGHT_GREY,C_LIGHT_GREY,C_LIGHT_GREY).
  156. SetThingStatus(r_provingTunnelD, ts_readonly).
  157. monsterSet3(r_provingTunnelD).
  158.  
  159. define tp_proving1 r_sewer1 CreateThing(r_provingTunnel1).
  160. SetupRoomP(r_sewer1, "in a north-south sewer",
  161.     "This is fairly large tunnel made of wood and stone, with a trickle of "
  162.     "noxious water flowing along the floor. "
  163.     "There is a grating overhead with metal wrungs leading up to it.").
  164. HUniConnect(r_alley2, r_sewer1, D_DOWN).
  165. UniConnect(r_sewer1, r_alley2, D_UP).
  166. r_alley2@p_rDownOMessage := ".".
  167. r_alley2@p_rDownEMessage := ".".
  168. AddTail(r_sewer1@p_rContents, o_trickle).
  169. AddTail(r_sewer1@p_rContents, o_drink).
  170. AddTail(r_sewer1@p_rContents, o_fakeGrate).
  171. Scenery(r_sewer1, "wall.wood.stone.wrung;metal").
  172. define tp_proving1 o_drainageGrate1 CreateThing(o_drainageGrate).
  173. AddTail(r_alley2@p_rContents, o_drainageGrate1).
  174. define tp_proving1 proc grateLift1()status:
  175.     grateLiftDown(r_sewer1);
  176.     succeed
  177. corp;
  178. o_drainageGrate1@p_oLiftChecker := grateLift1.
  179. o_drainageGrate1@p_oOpenChecker := grateLift1.
  180. SetThingStatus(o_drainageGrate1, ts_wizard).
  181. define tp_proving1 proc grateLift2()status:
  182.     /* Only players, "standard" monsters (Packrat, etc.) and monsters who
  183.        can reward with money (i.e. intelligent ones) can lift the grate. */
  184.     if Me()@p_pStandard or Me()@p_pMoney ~= 0 then
  185.     grateLiftDown(r_sewer1);
  186.     fi;
  187.     fail
  188. corp;
  189. AddDownChecker(r_alley2, grateLift2, false).
  190. define tp_proving1 proc grateLift3()status:
  191.     if Me()@p_pStandard or Me()@p_pMoney ~= 0 then
  192.     grateLiftUp(r_alley2)
  193.     else
  194.     fail
  195.     fi
  196. corp;
  197. AddUpChecker(r_sewer1, grateLift3, false).
  198.  
  199. define tp_proving1 r_sewer2 CreateThing(r_provingTunnel1).
  200. SetupRoomP(r_sewer2, "in a north-south sewer",
  201.     "You can barely see by natural light here. A dark opening heads west.").
  202. AddTail(r_sewer2@p_rContents, o_trickle).
  203. AddTail(r_sewer2@p_rContents, o_drink).
  204. Connect(r_sewer1, r_sewer2, D_SOUTH).
  205. Scenery(r_sewer2, "opening;dark").
  206.  
  207. define tp_proving1 r_sewer3 CreateThing(r_provingTunnel1).
  208. SetupRoomP(r_sewer3, "in a north-south sewer",
  209.     "Light comes down from a manhole above, casting a dim light on the "
  210.     "scummy water covering your feet.").
  211. AddTail(r_sewer3@p_rContents, o_trickle).
  212. AddTail(r_sewer3@p_rContents, o_drink).
  213. Connect(r_sewer2, r_sewer3, D_SOUTH).
  214. AddTail(r_sewer3@p_rContents, o_manholeCover).
  215.  
  216. define tp_proving1 r_sewer4 CreateThing(r_provingTunnel1).
  217. SetupRoomP(r_sewer4, "in a north-south sewer",
  218.     "You can barely see by natural light here. A dark opening heads east.").
  219. AddTail(r_sewer4@p_rContents, o_trickle).
  220. AddTail(r_sewer4@p_rContents, o_drink).
  221. Connect(r_sewer3, r_sewer4, D_SOUTH).
  222. Scenery(r_sewer4, "opening;dark").
  223.  
  224. define tp_proving1 r_sewer5 CreateThing(r_provingTunnel1).
  225. SetupRoomP(r_sewer5, "in a north-south sewer",
  226.     "This is fairly large tunnel made of wood and stone, with a trickle of "
  227.     "noxious water flowing along the floor. "
  228.     "There is a grating overhead with metal wrungs leading up to it.").
  229. Connect(r_sewer4, r_sewer5, D_SOUTH).
  230. HUniConnect(r_alley4, r_sewer5, D_DOWN).
  231. UniConnect(r_sewer5, r_alley4, D_UP).
  232. r_alley4@p_rDownOMessage := ".".
  233. r_alley4@p_rDownEMessage := ".".
  234. AddTail(r_sewer5@p_rContents, o_trickle).
  235. AddTail(r_sewer5@p_rContents, o_drink).
  236. AddTail(r_sewer5@p_rContents, o_fakeGrate).
  237. Scenery(r_sewer5, "wall.wood.stone.wrung;metal").
  238. define tp_proving1 o_drainageGrate2 CreateThing(o_drainageGrate).
  239. AddTail(r_alley4@p_rContents, o_drainageGrate2).
  240. define tp_proving1 proc grateLift4()status:
  241.     grateLiftDown(r_sewer5);
  242.     succeed
  243. corp;
  244. o_drainageGrate2@p_oLiftChecker := grateLift4.
  245. o_drainageGrate2@p_oOpenChecker := grateLift4.
  246. SetThingStatus(o_drainageGrate2, ts_wizard).
  247. define tp_proving1 proc grateLift5()status:
  248.     if Me()@p_pStandard or Me()@p_pMoney ~= 0 then
  249.     grateLiftDown(r_sewer5);
  250.     fi;
  251.     fail
  252. corp;
  253. AddDownChecker(r_alley4, grateLift5, false).
  254. define tp_proving1 proc grateLift6()status:
  255.     if Me()@p_pStandard or Me()@p_pMoney ~= 0 then
  256.     grateLiftUp(r_alley4)
  257.     else
  258.     fail
  259.     fi
  260. corp;
  261. AddUpChecker(r_sewer5, grateLift6, false).
  262.  
  263. define tp_proving1 r_sewer0 CreateThing(r_provingTunnel1).
  264. SetupRoomP(r_sewer0, "in a north-south sewer",
  265.     "This appears to be the north end of the sewer. A trickle of water "
  266.     "comes down the walls and heads south, but there are no other exits.").
  267. AddTail(r_sewer0@p_rContents, o_trickle).
  268. AddTail(r_sewer0@p_rContents, o_drink).
  269. Connect(r_sewer1, r_sewer0, D_NORTH).
  270. Scenery(r_sewer0, "wall").
  271.  
  272. define tp_proving r_sewerShaft1 CreateThing(r_provingTunnelD).
  273. SetupRoom(r_sewerShaft1, "in a vertical shaft",
  274.     "Rusty metal wrungs in the wall allow you to climb down here, and a "
  275.     "small opening heads east.").
  276. Connect(r_sewer2, r_sewerShaft1, D_WEST).
  277. Scenery(r_sewerShaft1, "wrung;metal.opening;small").
  278.  
  279. define tp_proving r_sewerShaft3 CreateThing(r_provingTunnelD).
  280. SetupRoom(r_sewerShaft3, "in a vertical shaft",
  281.     "Rusty metal wrungs in the wall allow you to climb down here, and a "
  282.     "small opening heads west.").
  283. Connect(r_sewer4, r_sewerShaft3, D_EAST).
  284. Scenery(r_sewerShaft3, "wrung;metal.opening;small").
  285.  
  286. define tp_proving r_sewer6 CreateThing(r_provingTunnel1).
  287. SetupRoomP(r_sewer6, "in a north-south sewer",
  288.     "On the west wall there is a small iron grill. There appears to be "
  289.     "open space behind it, but you can find no way to get into it.").
  290. AddTail(r_sewer6@p_rContents, o_trickle).
  291. AddTail(r_sewer6@p_rContents, o_drink).
  292. Connect(r_sewer5, r_sewer6, D_SOUTH).
  293. Scenery(r_sewer6, "grill;small,iron.space;open").
  294.  
  295. define tp_proving1 r_sewer7 CreateThing(r_provingTunnelD).
  296. SetupRoomP(r_sewer7, "in a north-south sewer", "").
  297. AddTail(r_sewer7@p_rContents, o_trickle).
  298. AddTail(r_sewer7@p_rContents, o_drink).
  299. Connect(r_sewer6, r_sewer7, D_SOUTH).
  300.  
  301. define tp_proving1 r_sewer8 CreateThing(r_provingTunnelD).
  302. SetupRoomP(r_sewer8, "in a north-south sewer", "").
  303. AddTail(r_sewer8@p_rContents, o_trickle).
  304. AddTail(r_sewer8@p_rContents, o_drink).
  305. Connect(r_sewer7, r_sewer8, D_SOUTH).
  306.  
  307. define tp_proving1 r_sewer9 CreateThing(r_provingTunnelD).
  308. SetupRoomP(r_sewer9, "at a north and southwest corner in the sewer", "").
  309. AddTail(r_sewer9@p_rContents, o_trickle).
  310. AddTail(r_sewer9@p_rContents, o_drink).
  311. Connect(r_sewer8, r_sewer9, D_SOUTH).
  312.  
  313. define tp_proving1 r_sewer10 CreateThing(r_provingTunnelD).
  314. SetupRoomP(r_sewer10, "in a sewer running northeast to southwest", "").
  315. AddTail(r_sewer10@p_rContents, o_trickle).
  316. AddTail(r_sewer10@p_rContents, o_drink).
  317. Connect(r_sewer9, r_sewer10, D_SOUTHWEST).
  318.  
  319. define tp_proving1 r_sewer11 CreateThing(r_provingTunnelD).
  320. SetupRoomP(r_sewer11, "at a northeast and west corner in the sewer", "").
  321. AddTail(r_sewer11@p_rContents, o_trickle).
  322. AddTail(r_sewer11@p_rContents, o_drink).
  323. Connect(r_sewer10, r_sewer11, D_SOUTHWEST).
  324.  
  325. define tp_proving1 r_sewer12 CreateThing(r_provingTunnel1).
  326. SetupRoomP(r_sewer12, "in an east-west sewer",
  327.     "You can see an opening to the west.").
  328. AddTail(r_sewer12@p_rContents, o_trickle).
  329. AddTail(r_sewer12@p_rContents, o_drink).
  330. Connect(r_sewer11, r_sewer12, D_WEST).
  331.  
  332. define tp_proving1 r_sewer13 CreateThing(r_provingTunnel1).
  333. SetupRoomP(r_sewer13, "at the end of the sewer",
  334.     "This is fairly large tunnel made of wood and stone, with a trickle of "
  335.     "noxious water flowing along the floor. "
  336.     "The sewer extends into the darkness to the east. The west end of the "
  337.     "tunnel is blocked by an iron bar grating. Through the bars you can see "
  338.     "that the sewer drains into a small stream in a forest.").
  339. AddTail(r_sewer13@p_rContents, o_trickle).
  340. AddTail(r_sewer13@p_rContents, o_drink).
  341. Connect(r_sewer12, r_sewer13, D_WEST).
  342. Scenery(r_sewer13,
  343.     "sewer.stream;small.forest.darkness.stonework.work;stone.stone."
  344.     "mouth;tunnel.tunnel").
  345. AddTail(r_sewer13@p_rContents, o_barGrating).
  346. AddTail(r_sewer13@p_rContents, o_gratingLatch).
  347. define tp_proving1 proc showAgent1(thing agent)void:
  348.     string name;
  349.  
  350.     name := agent@p_pName;
  351.     if name ~= "" and not agent@p_pHidden then
  352.     Print(FormatName(name) + " is outside the grating.\n");
  353.     fi;
  354. corp;
  355. define tp_proving1 proc extraDesc1()void:
  356.     ForEachAgent(r_forestByStream, showAgent1);
  357. corp;
  358. r_sewer13@p_rFurtherDesc := extraDesc1.
  359. define tp_proving1 proc showAgent2(thing agent)void:
  360.     string name;
  361.  
  362.     name := agent@p_pName;
  363.     if name ~= "" and not agent@p_pHidden then
  364.     Print(FormatName(name) + " is inside the grating.\n");
  365.     fi;
  366. corp;
  367. define tp_proving1 proc extraDesc2()void:
  368.     ForEachAgent(r_sewer13, showAgent2);
  369. corp;
  370. r_forestByStream@p_rFurtherDesc := extraDesc2.
  371.  
  372. define tp_proving1 p_rGratingSpecial CreateBoolProp().
  373.  
  374. define tp_proving1 proc barGratingOpen()status:
  375.     thing me;
  376.     bool hidden;
  377.  
  378.     r_sewer13@p_rGratingSpecial := true;
  379.     me := Me();
  380.     hidden := me@p_pHidden;
  381.     if hidden then
  382.     OPrint("The grating opens, then closes again.\n");
  383.     fi;
  384.     if Here() = r_sewer13 then
  385.     Print("You pull on the latch mechanism. It is rusty and hard to move "
  386.         "but you are able to release it and open the grating. You step "
  387.         "out of the sewer beside the stream and close the grating.\n");
  388.     if not hidden then
  389.         OPrint(me@p_pName + " opens the grating, goes outside, closes the "
  390.         "grating, and disappears out of sight.\n");
  391.     fi;
  392.     LeaveRoomStuff(r_forestByStream, D_EXIT, MOVE_SPECIAL);
  393.     EnterRoomStuff(r_forestByStream, D_ENTER, MOVE_SPECIAL);
  394.     if not hidden then
  395.         OPrint(me@p_pName +
  396.         " opens the grating and climbs out of the sewer.\n");
  397.     fi;
  398.     else
  399.     Print("You pull on the latch mechanism. It is rusty and hard to move "
  400.         "but you are able to release it and open the grating. You climb "
  401.         "into the sewer and the grating bangs shut behind you.\n");
  402.     if not hidden then
  403.         OPrint(me@p_pName + " opens the grating and climbs into the sewer."
  404.         " The grating bangs shut.\n");
  405.     fi;
  406.     LeaveRoomStuff(r_sewer13, D_ENTER, MOVE_SPECIAL);
  407.     EnterRoomStuff(r_sewer13, D_EXIT, MOVE_SPECIAL);
  408.     if not hidden then
  409.         OPrint(me@p_pName +
  410.         " opens the grating and climbs into the sewer.\n");
  411.     fi;
  412.     fi;
  413.     if hidden then
  414.     OPrint("The grating opens, then closes again.\n");
  415.     fi;
  416.     r_sewer13@p_rGratingSpecial := false;
  417.     succeed
  418. corp;
  419. o_gratingLatch@p_oOpenChecker := barGratingOpen.
  420. o_gratingLatch@p_oPullChecker := barGratingOpen.
  421.  
  422. define tp_proving1 m_watcher1 CreateThing(nil).
  423. CreateMachine("", m_watcher1, r_forestByStream, nil).
  424. define tp_proving1 proc watch1(string s)void:
  425.     if not r_sewer13@p_rGratingSpecial and
  426.     SubString(s, 0, 20) ~= "Inside the grating, "
  427.     then
  428.     ABPrint(r_sewer13, nil, nil, "Outside the grating, " + s + "\n");
  429.     fi;
  430. corp;
  431. ignore SetMachineOther(m_watcher1, watch1).
  432.  
  433. define tp_proving1 m_watcher2 CreateThing(nil).
  434. CreateMachine("", m_watcher2, r_sewer13, nil).
  435. define tp_proving1 proc watch2(string s)void:
  436.     if not r_sewer13@p_rGratingSpecial and
  437.     SubString(s, 0, 21) ~= "Outside the grating, "
  438.     then
  439.     ABPrint(r_forestByStream, nil, nil, "Inside the grating, " + s + "\n");
  440.     fi;
  441. corp;
  442. ignore SetMachineOther(m_watcher2, watch2).
  443.  
  444. unuse tp_proving1
  445.